package com.kgc.scd.service.impl;

import com.kgc.scd.entity.ShopAddressTLX;
import com.kgc.scd.mapper.ShopAddressTLXMapper;
import com.kgc.scd.service.ShopAddressServerService;
import com.kgc.scd.vo.ShopAddressVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created On : 2022/11/16.
 * <p>
 * Author : Administrator
 * <p>
 * Description: ShopAddressServerServiceImpl
 */
@Slf4j
@Service
public class ShopAddressServerServiceImpl implements ShopAddressServerService {


    @Autowired(required = false)
    private ShopAddressTLXMapper shopAddressMapper;

    @Override
    public ShopAddressVO getShopAddressById(String addressId) {

        ShopAddressTLX shopAddress=shopAddressMapper.selectById(addressId);

        ShopAddressVO shopAddressVO=new ShopAddressVO();


        BeanUtils.copyProperties(shopAddress,shopAddressVO);
        if(shopAddress.isStatus()){
            shopAddressVO.setStatus("默认地址");
        }else {
            shopAddressVO.setStatus("不是默认地址");
        }
        return shopAddressVO;
    }
}
